import request from '@/utils/request'
import { GET_USER_INFO, CLEAR_USER_INFO } from '../actionTypes'
export function getUserInfo () {
  return async (dispatch) => {
    const res = await request.get('/user')
    dispatch({
      type: GET_USER_INFO,
      payload: res.data
    })
  }
}
export function clearUserInfo () {
  return (dispatch) => {
    dispatch({
      type: CLEAR_USER_INFO
    })
  }
}
